package cn.edu.scau.cmi.zhengweixin.singleton;

import java.net.URL;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;


public class SingletonController {

    @FXML
    private ResourceBundle resources;

    @FXML
    private URL location;

    @FXML
    private TextField nameTextField;

    @FXML
    private TextArea outputTextArea;


    @FXML
    void createChairman(ActionEvent event) {
    	String name = nameTextField.getText();
    	ChairmanSington chairman = ChairmanSington.getInstance(name);
    	outputTextArea.appendText(chairman.toString() + "\n");
    }

    @FXML
    void initialize() {
        assert nameTextField != null : "fx:id=\"nameTextField\" was not injected: check your FXML file 'Singleton.fxml'.";
        assert outputTextArea != null : "fx:id=\"outputTextArea\" was not injected: check your FXML file 'Singleton.fxml'.";


    }

}
